#!/bin/bash

# 创建数据库迁移脚本

if [ -z "$1" ]; then
    echo "❌ 错误: 请提供迁移描述"
    echo "用法: ./scripts/create_migration.sh \"migration description\""
    exit 1
fi

cd "$(dirname "$0")/.." || exit

echo "📝 创建数据库迁移: $1"

# 自动生成迁移脚本
alembic revision --autogenerate -m "$1"

echo "✅ 迁移脚本创建完成"
echo "📌 下一步: 检查生成的迁移脚本，然后运行:"
echo "   alembic upgrade head"

